Ext.onReady(function() {

	var myStore = new Ext.data.ArrayStore({
				fields : ['name', 'url'],
				idIndex : 0
			});
	var myData = [
			// 这里还要注意路径，如果加上一个/则表是tomcat根目录
			['搞笑', '../../images/phones/1.png'], ['刘9菲', '../../images/phones/2.png'],
			['刘1菲', '../../images/phones/2.png'], ['刘11菲', '../../images/phones/2.png'],
			['刘2菲', '../../images/phones/2.png'], ['刘22菲', '../../images/phones/2.png'],
			['刘3菲', '../../images/phones/2.png'], ['刘33菲', '../../images/phones/2.png'],
			['刘4菲', '../../images/phones/2.png'], ['刘44菲', '../../images/phones/2.png'],
			['刘5菲', '../../images/phones/2.png'], ['刘55菲', '../../images/phones/2.png'],
			['刘6菲', '../../images/phones/2.png'], ['刘66菲', '../../images/phones/2.png'],
			['刘7菲', '../../images/phones/2.png'], ['刘77菲', '../../images/phones/2.png'],
			['刘8菲', '../../images/phones/2.png'], ['刘88菲', '../../images/phones/2.png']];
	myStore.loadData(myData);
	var domInfoPanel = new Ext.DataView({
				region : 'north',
				height : 200,
				store : myStore,
				style : 'padding:10px 10px 10px 10px',
				tpl : new Ext.XTemplate(
						'<tpl for=".">',
						'<div class="thumb-wrap" style="float: left;" id="{name}">',// 注意这个div样式的应用，没有这个样式则显示效果不佳
						'<div class="thumb"><img src="{url}" title="{name}"></div>',
						'<span class="x-editable">{name}</span></div>',
						'</tpl>', '<div class="x-clear"></div>'),
				autoHeight : true,
				multiSelect : false,
				overClass : 'x-view-over',
				itemSelector : 'div.thumb-wrap',
				emptyText : 'No images to display'
			});
	var memberInfoPanel = new Ext.Panel({
				//layout : 'border',
		region:'center',
				id : 'memberInfoPanel',
				title : '宿舍基本信息（虚拟）',
				collapsible : true,
				html:'tesss'
				//items : grid
			});
	// 布局
	var viewport = new Ext.Viewport({
				layout : 'border',
				width : '100%',
				height : '100%',
				items : [domInfoPanel, memberInfoPanel]
			});

	Ext.get('loading').remove();
});

var win;
function cellclick(grid, rowIndex, e) {
	// var record = grid.getStore().getAt(rowIndex); //Get the Record
	// var fieldName = grid.getColumnModel().getDataIndex(columnIndex); //Get
	// field name
	// var data = record.get(fieldName);
	// Ext.MessageBox.alert('show','asdf'+rowIndex);
	if (!win) {
		var tabs = new Ext.TabPanel({
			activeTab : 0,
			frame : true,
			// defaults:{autoHeight: true},
			items : [{
				title : '基本信息',
				html : document.getElementById('student_basic_info_content2').innerHTML
			}, {
				title : '住宿历史',
				html : document.getElementById('student_basic_info_content3').innerHTML
			}, {
				title : '交费信息',
				html : document.getElementById('student_basic_info_content4').innerHTML
			}, {
				title : '卫生评比',
				html : document.getElementById('student_basic_info_content5').innerHTML
			}, {
				title : '备注',
				html : document.getElementById('student_basic_info_content6').innerHTML
			}]
		});
		win = new Ext.Window({
					title : '个人明细',
					layout : 'fit',
					width : 500,
					height : 300,
					closeAction : 'hide',
					plain : true,
					modal : true,
					items : [tabs],
					buttons : [
							// {
							// text:'Submit'
							// },
							{
						text : 'Close',
						handler : function() {
							win.hide();
						}
					}]
				});
	}
	win.show();
	// Ext.MessageBox.show(win);
}
function showRoomInfo(id) {
	var myData = [['50991048', '苏凌菲', '女', '英语0902', '外国语学院', '英语' + id],
			['50991052', '高雪莲', '女', '英语0902', '外国语学院', '英语' + id],
			['50991053', '梁名扬', '女', '英语0902', '外国语学院', '英语' + id],
			['50991054', '梁芳敏', '女', '英语0902', '外国语学院', '英语' + id],
			['50991055', '梁维珊', '女', '英语0902', '外国语学院', '英语' + id],
			['50991056', '葛心怡', '女', '英语0902', '外国语学院', '英语' + id]];
	// window.frames[0].location ='listmember.jsp';
	// document.getElementById('listroom_iframe_center').location
	// ='listmember.jsp';
	var store = Ext.getCmp('mygrid').store;
	store.loadData(myData);
	Ext.getCmp('memberInfoPanel').expand(true);
}